package servidorLocalizacion.GUI;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;


public class AdminLocalizacion extends JFrame implements ActionListener, WindowListener{

	private static final long serialVersionUID = 1L;

	public final static int MODIFICAR = 0, CREAR = 1, CONECTAR = 2;
	
	private JLabel mensaje;
	private JButton bCerrar;
	
	public AdminLocalizacion(){
		mensaje = new JLabel("Pulsa el boton para cerrar el servidor de localizacion");
		bCerrar = new JButton("Cerrar");
		bCerrar.addActionListener(this);
		
		JPanel panel1 = new JPanel();
		panel1.setLayout(new FlowLayout());
		panel1.add(mensaje);
		JPanel panel2 = new JPanel();
		panel2.setLayout(new FlowLayout());
		panel2.add(bCerrar);
		getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
		getContentPane().add(panel1);
		getContentPane().add(panel2);
		setMinimumSize(new Dimension(350, 120));
		setLocationRelativeTo(null);
		addWindowListener(this);
		setVisible(true);
	}
	
	@Override
	public void actionPerformed(ActionEvent e) {
		System.exit(0);
	}

	@Override
	public void windowActivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowClosed(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowClosing(WindowEvent arg0) {
		System.exit(0);		
	}

	@Override
	public void windowDeactivated(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowDeiconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowIconified(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void windowOpened(WindowEvent arg0) {
		// TODO Auto-generated method stub
		
	}
	
}